ThunderManager={};
local this = ThunderManager;
local CreatEnemyTime=0;
local CreatBossTime=0;
local ScoreText;
local score=0;
local panel;
this.prefabName={'mainPlayer','Bullet','Enemy','Boss','EnemyBullet','smallEnemyBullet'};
this.prefabs={};

function ThunderManager.New()
    resMgr:LoadPrefab("Player",this.prefabName,this.OnLoadPrefab);
    UpdateBeat:Add(this.Update);
    this.ScoreText=GameObject.Find("GamePanel/Score"):GetComponent(typeof(Text));
    this.panel=GameObject.Find("Panel");
end
function ThunderManager.Update()
    this.CreatEnemy();
    this.ScoreText.text="Score:"..score;
    this.panel.transform:Translate(Vector3.down*1*Time.deltaTime);
    print(this.panel.transform.position.y.."----------")
    if(this.panel.transform.position.y<=-10.5)then
        print("进来了----------")
        this.panel.transform.position=Vector3.zero
    end
end
function ThunderManager.CreatEnemy()
    CreatEnemyTime=CreatEnemyTime+Time.deltaTime;
    CreatBossTime=CreatBossTime+Time.deltaTime;
    if(CreatEnemyTime>2)then
        CreatEnemyTime=0;
        EnemyMove.new(2);
    end
    if(CreatBossTime>10)then
        CreatBossTime=0;
        BossMove.new();
    end
end
function ThunderManager.OnLoadPrefab(objs)
    for i=1,objs.Length do
        table.insert( this.prefabs, objs[i-1] )
    end
    -- body
    PlayerMove.New();
    
end
function ThunderManager.ScoreAdd(a)
    score=score+a;
end